# 自省是通过一定的机制查询到对象的内部结构

class Person:
    """
    人
    """
    name = "user"

class Student(Person):
    def __init__(self, school_name):
        self.school_name = school_name

if __name__ == '__main__':
    user = Student("慕课网")
    # 通过__dict__查询属性
    print(user.__dict__)
    print(Person.__dict__)

    print(user.name)# mro向上查找

    user.__dict__["school_addr"]= "北京市"
    print(user.school_addr)

    # dir()会列出对象的所有属性
    print(dir(user))
